﻿@inherits LayoutComponentBase
@layout BaseLayout
@namespace ThingsGateway.Debug
@using BootstrapBlazor.Components
@using ThingsGateway.Core.Extension
@using ThingsGateway.Razor
@inject NavigationManager NavigationManager

<div class="mainlayout">

    <Layout SideWidth="0" IsPage="true" IsFullSide="true" IsFixedHeader="true"
            ShowGotoTop="true" ShowCollapseBar="true" Menus="@MenuService.MenuItems"
            AllowDragTab=true AdditionalAssemblies="@_assemblyList"
            UseTabSet="false" TabDefaultUrl="/">
        <Header>

            @* 搜索框 *@
            <GlobalSearch Menus=@(MenuService.SameLevelMenuItems) />
            @* 语言选择 *@
            <CultureChooser />

            @* 主题切换 *@
            <ThemeToggle />

            @* 版本号 *@
            <div class="px-2 navbar-header-text d-none d-lg-block">@_versionString</div>


        </Header>
        <Side>
            <div class="layout-banner">
                <span class="avatar">
                    @WebsiteOption.Value.Title?.GetNameLen2()
                </span>

                <div class="layout-title d-flex align-items-center justify-content-center">
                    <span>@WebsiteOption.Value.Title</span>
                </div>
            </div>
        </Side>
        <Main>
            <Tab ClickTabToNavigation="true" ShowExtendButtons="true" ShowClose="true" AllowDrag=true
                 Menus="@MenuService.MenuItems" AdditionalAssemblies="@_assemblyList"
                 DefaultUrl=@("/") Body=@(Body!)>
            </Tab>

        </Main>
        <NotAuthorized>
            <Redirect />
        </NotAuthorized>
    </Layout>

</div>


